﻿using System.Linq;
using SportTraining.Core.Domain;

namespace SportTraining.Core.Linq2Sql
{
    public partial class Section : ISection
    {
        public override string ToString()
        {
            return string.Format("{0} {1}", Id, Name);
        }

        #region Implementation of ISection

        public IPrice ActualPrice
        {
            get { return Prices.FirstOrDefault(item => item.ExpireDate == null); }
        }
        #endregion
    }
}
